package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

/**
 * 说明:
 *
 * @author:SuZhongHe
 * @date:2023/3/2
 **/
public class NewForDemo {
    public static void main(String[] args) {
        Collection c=new ArrayList();
        c.add("a");
        c.add("b");
        c.add("c");
        c.add("d");
        c.add("e");
        /*
        Iterator it = c.iterator();
        while (it.hasNext()) {
            String s = (String) it.next();
            System.out.println(s);
        }
        System.out.println("-------");
        String[]arrays={"1","2","3","4","5"};
        for (int i = 0; i < arrays.length; i++) {
            System.out.println(arrays[i]);
        }
        System.out.println("-------");

         */
        for (Object o : c) {
            String s=(String)o;
            System.out.println(s);

        }
        System.out.println("------");
        /*
        for (String array : arrays) {
            System.out.println(array);
        }

         */

    }


}
